Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

275
Visualizações
I tried to get data using filter in nodejs and firestore when show me this error "Cannot read properties of undefined (reading '_internalPath')"

I tried to get data using filter in nodejs and firestore when show me this error in postman

"Cannot read properties of undefined (reading '_internalPath')"

my code

const getAllWords = async (req, res, next) => {
     let categoryName = "fruits"
    
    try {
        const word = await firestore.collection('12words');
        const data = await word.where({categoryName}).get();
        const wordArray = []; 
        if(data.empty) {
            res.status(404).send('No words12  found');
        }else {
            data.forEach(doc => {
                const words = new Word12(
                    doc.id,
                    doc.data().name,
                    doc.data().categoryName,
                    
                );
                wordArray.push(words);
            });
            res.send(wordArray);
        }
    } catch (error) {
        res.status(400).send(error.message);
    }
}
almost 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The .where() takes 3 parameters (fieldPath, opStr, value) but you are passing only 1 object. Try refactoring the code as shown below:

// replace fieldName with the field name in document
const data = await word.where("fieldName", "==", categoryName).get();
almost 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda